#!/bin/bash

#官方安装文档
#https://www.jenkins.io/zh/doc/book/installing/

## docker network create --driver bridge --subnet 172.18.0.0/24 --gateway 172.18.0.1 mynet

docker pull jenkins/jenkins

jenkinsHome=/opt/jenkins_home
mkdir -p $jenkinsHome
chmod 777 $jenkinsHome

docker run -d --name jenkins --restart=always \
-u root \
-p 18008:8080 \
-p 50001:50000 \
-v $jenkinsHome:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkins/jenkins
